{include file=member.header.html}
<script type="text/javascript">
    $(function() {
        $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd'});
        $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd'});
        $('.checkall_s').click(function() {
            var if_check = $(this).attr('checked');
            $('.checkitem').each(function() {
                if (!this.disabled)
                {
                    $(this).attr('checked', if_check);
                }
            });
            $('.checkall_s').attr('checked', if_check);
        });
        $('a[ectype="batchcancel"]').click(function() {
            if ($('.checkitem:checked').length == 0) {
                return false;
            }
            if ($(this).attr('presubmit')) {
                if (!eval($(this).attr('presubmit'))) {
                    return false;
                }
            }
            var items = '';
            $('.checkitem:checked').each(function() {
                items += this.value + ',';
            });
            items = items.substr(0, (items.length - 1));

            var uri = $(this).attr('uri');
            uri = uri + '&' + $(this).attr('name') + '=' + items;
            var id = 'seller_order_cancel_order';
            var title = $(this).attr('dialog_title') ? $(this).attr('dialog_title') : '';
            //var url = $(this).attr('uri');
            var width = '500';
            ajax_form(id, title, uri, width);
        });
    });
</script>
<div class="content">
    {include file=member.menu.html}
    <div id="right">
        {include file=member.curlocal.html}
        {include file=member.submenu.html}
        <div class="wrap">
            <div class="public_index table">
                <table>
                    <tr class="line_bold">
                        <th colspan="9">
                    <div class="search_order clearfix">
                        <form method="get" class="clearfix">
                            <div style="float:left;">
                                <span class="title">{$lang.order_sn}:</span>
                                <input class="text_normal" type="text" name="order_sn" value="{$query.order_sn|escape}" />
                                <span class="title">{$lang.add_time}:</span>
                                <input class="text_normal width2" type="text" name="add_time_from" id="add_time_from" value="{$query.add_time_from}" /> &#8211; <input class="text_normal width2" id="add_time_to" type="text" name="add_time_to" value="{$query.add_time_to}" />
                                <span class="title">{$lang.buyer_name}:</span>
                                <input class="text_normal" type="text" name="buyer_name" value="{$query.buyer_name|escape}" />
                                <input type="hidden" name="app" value="seller_order" />
                                <input type="hidden" name="act" value="index" />
                                <input type="hidden" name="type" value="{$type}" />
                                <input type="submit" class="btn" value="{$lang.search}" />
                            </div>
                            <!--{if $query.buyer_name or $query.add_time_from or $query.add_time_to or $query.order_sn}-->
                            <a class="detlink" href="{url app=seller_order&type=$query.type}">{$lang.cancel_query}</a>
                            <!--{/if}-->
                        </form>
                    </div>
                    </th>
                    </tr>
                    <tr class="sep-row" height="20"><td colspan="9"></td></tr>
                    <tr class="line gray">
                        <th>{$lang.goods_name}</th>
                        <th>{$lang.price}</th>
                        <th>{$lang.quantity}</th>
                        <th></th>
                        <th>{$lang.payment_name}</th>
                        <th>{$lang.buyer_name}</th>
                        <th>{$lang.order_amount}</th>
                        <th>{$lang.order_status}</th>
                        <!--lichen 2019/5/5 start-->
                        <th>{$lang.customs_status}</th>
                        <!--lichen 2019/5/5 end-->
                        <th>{$lang.evaluation}</th>
                    </tr>
                    <!--{if $orders}-->
                    <!--lichen 2019/5/5 start-->
                    <!--<tr class="sep-row"><td colspan="9"></td></tr>-->
                    <tr class="sep-row"><td colspan="10"></td></tr>
                    <!--lichen 2019/5/5 end-->
                    <tr class="operations">
                        <!--lichen 2019/5/5 start-->
                        <!--<th colspan="9">-->
                        <th colspan="10">
                        <!--lichen 2019/5/5 end-->
                    <p class="position0 clearfix">
                        <input type="checkbox" id="all" class="checkall"/>
                        <label for="all">{$lang.checkall}</label>
                        <a href="javascript:;" class="delete" ectype="batchcancel" uri="index.php?app=seller_order&act=cancel_order" name="order_id">{$lang.cancel_order}</a>
                    </p>
                    <p class="position2 clearfix">
                        {include file=member.page.top.html}
                    </p>
                    </th>
                    </tr>
                    <!--{/if}-->

                    <!-- 循环开始 -->
                    <!--{foreach from=$orders item=order name=fe_order}-->
                    <!--lichen 2019/5/5 start-->
                    <!--<tr class="sep-row"><td colspan="9"></td></tr>-->
                    <tr class="sep-row"><td colspan="10"></td></tr>
                        <!--lichen 2019/5/5 end-->
                    <tr class="line-hd">
                        <!--lichen 2019/5/5 start-->
                        <!--<th colspan="9">-->
                        <th colspan="10">
                            <!--lichen 2019/5/5 end-->
                    <p>
                        <input type="checkbox" value="{$order.order_id}" class="checkitem" <!--{if $order.status eq ORDER_FINISHED || $order.status eq ORDER_CANCELED}--> disabled="disabled" <!--{/if}-->/>
                               <label>{$lang.order_sn}：</label>{$order.order_sn}
                        <label>{$lang.add_time}：</label>{$order.add_time|date:Y-m-d H:i:s}
                        <!--{if $order.status eq ORDER_SHIPPED && $order.payment_code neq 'cod' && $order.payment_code neq 'bank' && $order.payment_code neq 'post'}-->
                        <strong style="color:red;padding-left: 10px;">{$order.auto_finished_time|date:Y-m-d H:i:s}</strong><label>{$lang.auto_take}</label>
                        <!--{/if}-->
                    </p>
                    </th>
                    </tr>
                    <!--{foreach from=$order.order_goods item=goods name=fe_goods}-->
                    <tr class="line<!--{if $smarty.foreach.fe_goods.last}--> last_line<!--{/if}-->">
                        <td valign="top" class="first clearfix">
                            <div class="pic-info fleft">
                                <a href="{url app=goods&id=$goods.goods_id}" target="_blank"><img src="{$goods.goods_image}" width="50" height="50" /></a>
                            </div>
                            <div class="txt-info fleft">
                                <div class="txt">
                                    <a href="{url app=goods&id=$goods.goods_id}" target="_blank">{$goods.goods_name}</a>
                                </div>
                                <!--{if $goods.specification}--><p class="gray-color mt5">{$goods.specification}</p><!--{/if}-->
                            </div>
                        </td>
                        <td valign="top" class="align2">{$goods.price}</td>
                        <td valign="top" class="align2"><strong>{$goods.quantity}</strong></td>
                        <td valign="top" class="align2">
                            <!--{if $goods.status eq 'SUCCESS'}-->
                            <a href="{url app=buyer_order&act=view&order_id=$goods.order_id}" class="gray">{$lang.has_confirm}</a>
                            <!--{elseif $goods.refund_status eq 'SUCCESS'}-->
                            <a href="{url app=refund&act=view&refund_id=$goods.refund_id}">{$lang.refund_succed}</a>
                            <!--{elseif $goods.refund_status eq 'CLOSED'}-->
                            <a href="{url app=refund&act=view&refund_id=$goods.refund_id}" class="gray">{$lang.refund_colse}</a>
                            <!--{elseif $goods.refund_status eq 'FAILED'}-->
                            <a href="{url app=refund&act=view&refund_id=$goods.refund_id}" style="color:#ff6600">{$lang.refund_fail}</a>
							<!--{elseif $goods.refund_status eq 'WAIT_SELLER_AGREE'}-->
                            <a href="{url app=refund&act=view&refund_id=$goods.refund_id}">{$lang.refund}</a>
                            <!--{/if}-->
                        </td>
                        <!--{if $smarty.foreach.fe_goods.first}-->
                        <td valign="top" class="align2 bottom-blue" rowspan="{$order.goods_quantities}">
                            {$order.payment_name|escape}
                        </td>
                        <td valign="top" class="align2 bottom-blue" rowspan="{$order.goods_quantities}">
                            <a href="{url app=message&act=send&to_id=$order.buyer_id}" target="_blank">{$order.buyer_name|escape}</a>
                            <br />
                            <!--{if $order.buyer_info.real_name}-->{$order.buyer_info.real_name|escape|truncate:14}<!--{else}-->----<!--{/if}-->
                            <br />
                            <!--{if $order.buyer_info.im_qq}-->
                            <a href="http://wpa.qq.com/msgrd?V=1&amp;uin={$order.buyer_info.im_qq|escape}&amp;Site={$store.store_name|escape}&amp;Menu=yes" target="_blank"><img src="http://wpa.qq.com/pa?p=1:{$order.buyer_info.im_qq|escape}:5" alt="QQ"></a>
                            <!--{elseif $order.buyer_info.im_aliww}-->
                            <a target="_blank" href="http://amos.im.alisoft.com/msg.aw?v=2&uid={ $order.buyer_info.im_aliww|escape:url}&site=cntaobao&s=2&charset={$charset}" ><img border="0" src="http://amos.im.alisoft.com/online.aw?v=2&uid={ $order.buyer_info.im_aliww|escape:url}&site=cntaobao&s=2&charset={$charset}" alt="Wang Wang" /></a>
                            <!--{else}-->
                            <a target="_blank" href="{url app=message&act=send&to_id=$order.buyer_id}" class="email"></a>
                            <!--{/if}-->
                        </td>
                        <td valign="top" class="align2 bottom-blue" rowspan="{$order.goods_quantities}">
                            <strong>{$order.order_amount}</strong><br />
                            <span class="gray-color">({$lang.free_shipping}:{$order.shipping_fee})</span>
                            <div class="btn-order-status">
                                <!--//调整费用-->
                                <a href="javascript:;" uri="index.php?app=seller_order&amp;act=adjust_fee&amp;order_id={$order.order_id}&ajax" dialog_width="450" dialog_title="{$lang.adjust_fee}" ectype="dialog"  dialog_id="seller_order_adjust_fee" id="order{$order.order_id}_action_adjust_fee"{if $order.status neq ORDER_PENDING and $order.status neq ORDER_SUBMITTED} style="display:none"{/if} />{$lang.adjust_fee}</a>
                                <!--//收到货款-->
                                <a href="javascript:;" ectype="dialog" dialog_id="seller_order_received_pay" dialog_width="400" uri="index.php?app=seller_order&amp;act=received_pay&amp;order_id={$order.order_id}&ajax" dialog_title="{$lang.received_pay}" id="order{$order.order_id}_action_received_pay"{if $order.status neq ORDER_PENDING} style="display:none"{/if} />{$lang.received_pay}</a>
                            </div>
                        </td>
                        <td valign="top"class="align2 bottom-blue" rowspan="{$order.goods_quantities}">
                            <div class="btn-order-status">
                                <p><span class="{if $order.status==0}gray-color{else}color4{/if}">{$order.status|modifier:order_status}</span></p>
                                {if $order.status eq ORDER_FINISHED and $order.seller_evaluation_status eq '0'}<a class="btn1" href="{url app=seller_order&act=evaluate&order_id=$order.order_id}" target="_blank" >{$lang.seller_evaluate}</a>{/if}
                                <!--//查看订单-->
                                <a href="{url app=seller_order&act=view&order_id=$order.order_id}" target="_blank">{$lang.view_order}</a>
                                <!--//发货-->
                                <a href="javascript:;" class="btn-order-status-shipped" ectype="dialog" dialog_title="{$lang.shipped_order}" dialog_id="seller_order_shipped" uri="index.php?app=seller_order&amp;act=shipped&amp;order_id={$order.order_id}&ajax"  dialog_width="400" id="order{$order.order_id}_action_shipped"{if $order.status neq ORDER_ACCEPTED} style="display:none"{/if} />{$lang.shipped_order}</a>
                                <!--//取消订单 不是取消和完成的订单就可以取消-->
                                <a href="javascript:;" ectype="dialog" uri="index.php?app=seller_order&amp;act=cancel_order&order_id={$order.order_id}&ajax" dialog_title="{$lang.cancel_order}" dialog_id="seller_order_cancel_order" dialog_width="400" id="order{$order.order_id}_action_cancel"{if $order.status eq ORDER_CANCELED or $order.status eq ORDER_FINISHED} style="display:none"{/if} />{$lang.cancel_order}</a>
                                <!--//确认订单-->
                                <a href="javascript:;" ectype="dialog" uri="index.php?app=seller_order&amp;act=confirm_order&amp;order_id={$order.order_id}&ajax" dialog_id="seller_order_confirm_order" dialog_title="{$lang.confirm_cod_order}"  dialog_width="400" id="order{$order.order_id}_action_confirm"{if $order.status neq ORDER_SUBMITTED} style="display:none" {/if} />{$lang.confirm_cod_order}</a>
                                <!--//完成订单-->
                                <!--{if $enable_express}-->
                                <a target="_blank" class="btn1" href="{url app=order_express&amp;order_id=$order.order_id}" {if $order.status neq ORDER_SHIPPED && $order.status neq ORDER_FINISHED} style="display:none"{/if}>{$lang.view_delivery_track}</a>
                                <!--{/if}-->
                                <a href="javascript:;" ectype="dialog" dialog_id="seller_order_finished"  dialog_title="{$lang.finish_order}" uri="index.php?app=seller_order&amp;act=finished&order_id={$order.order_id}&ajax" dialog_width="400"  id="order{$order.order_id}_action_finish"{if $order.payment_code neq 'cod' or $order.status neq ORDER_SHIPPED} style="display:none"{/if} />{$lang.finish_order}</a>
                                <!--//修改单号-->
                                <a href="javascript:;" ectype="dialog" dialog_title="{$lang.edit_invoice_no}" uri="index.php?app=seller_order&amp;act=shipped&amp;order_id={$order.order_id}&ajax" dialog_id="seller_order_shipped" dialog_width="400" id="order{$order.order_id}_action_edit_invoice_no"{if $order.status neq ORDER_SHIPPED} style="display:none" {/if} />{$lang.edit_invoice_no}</a>
                                <a href="{url app=seller_order&act=orderprint&order_id=$order.order_id}" target="_blank">{$lang.print_detail}</a>
                            </div>
                        </td>
                        <!--lichen 2019/5/5 start-->
                        <td valign="top"class="align2 bottom-blue" rowspan="{$order.goods_quantities}">
                            <!--{if $order.customs_status eq CUSTOMS_SUCCESS}-->
                            <p class="gray-color">{$lang.customs_success}</p>
                            <!--{elseif $order.customs_status eq CUSTOMS_PROCESS}-->
                            <p class="gray-color">{$lang.customs_process}</p>
                            <!--{elseif $order.customs_status eq CUSTOMS_FAILDED}-->
                            <p class="gray-color">{$lang.customs_failded}</p>
                            <!--{else}-->
                            <p class="gray-color">{$lang.customs_submit}</p>
                            <!--{/if}-->
                            <!--//查看订单-->
                            <a href="{url app=seller_order&act=customs&order_id=$order.order_id}" target="_blank">{$lang.view_customs}</a>
                        </td>
                        <!--lichen 2019/5/5 end-->
                        <td valign="top" width="54" class="align2 bottom-blue last" rowspan="{$order.goods_quantities}">
                            <!--{if $order.evaluation_status}--><p class="gray-color">{$lang.already_evaluate}</p><!--{/if}-->
                        </td>
                        <!--{/if}-->
                    </tr>
                    <!--{/foreach}-->
                    <!--{foreachelse}-->
                    <tr><td class="member_no_records" colspan="9">{$lang.no_records}</td></tr>
                    <!--{/foreach}-->
                    <!--{if $orders}-->
                    <tr class="sep-row">
                        <td colspan="10"></td>
                    </tr>
                    <tr class="operations">
                        <th colspan="10">
                    <p class="position1 clearfix">
                        <input type="checkbox" id="all2" class="checkall"/>
                        <label for="all2">{$lang.checkall}</label>
                        <a href="javascript:;" class="delete" ectype="batchcancel" uri="index.php?app=seller_order&act=cancel_order" name="order_id">{$lang.cancel_order}</a>
                    </p>
                    <p class="position2 clearfix">
                        {include file=member.page.bottom.html}
                    </p>
                    </th>
                    </tr>
                    <!--{/if}-->
                </table>
                <iframe name="seller_order" style="display:none;"></iframe>
            </div>

        </div>
    </div>
</div>
<div class="clear"></div>
</div>
{include file=footer.html}
